package com.andrew.study.io;

import com.andrew.study.aware.SpringUtil;
import com.andrew.study.aware.UserBeanNameAware;
import com.andrew.study.domain.User;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.io.ClassPathResource;

import java.io.IOException;

public class XmlResourceBean {

	public static void main(String[] args) throws IOException {
		DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
		XmlBeanDefinitionReader definitionReader = new XmlBeanDefinitionReader(beanFactory);
		definitionReader.loadBeanDefinitions(new ClassPathResource("application.xml"));
		Object user = beanFactory.getBean("user");
		System.out.println(user.toString());

	}

}
